package com.hbue.service.impl;

import com.hbue.bean.Book;
import com.hbue.dao.BookDao;
import com.hbue.dao.MemberDao;
import com.hbue.dao.impl.BookDaoImpl;
import com.hbue.service.BookService;

import java.util.ArrayList;

public class BookServiceImpl implements BookService {

    private BookDao bookDao = new BookDaoImpl();
    @Override
    public ArrayList<Book> findAllBook() {
        ArrayList<Book> books = bookDao.findAllBook();
        return books;
    }

    @Override
    public void deleteBook(String id) {
        bookDao.deleteById(id);
    }

    @Override
    public Book findBook(String id) {
        return bookDao.findBook(id);
    }

    @Override
    public void updateBook(Book book) {
        bookDao.update(book);
    }

    @Override
    public void addBook(Book book) {
        bookDao.add(book);
    }

    @Override
    public ArrayList<Book> findBookBySearchContent(String searchContent) {
        return bookDao.findBookBySearchContent(searchContent);
    }
}
